﻿myApp.controller('NewLaunchController', function ($scope,$http, DUMMY_DATA) {
    pageInit();

    $scope.sortOption = "Sorted by High to Low";


    $scope.paginate = function (value) {
        var begin, end, index;
        begin = ($scope.currentPage - 1) * $scope.numPerPage;
        end = begin + $scope.numPerPage;
        index = $scope.searchData.indexOf(value);
        return (begin <= index && index < end);
    };
    $scope.updateFilterOption = function (option, sortedChanged) {
        $scope.SortOptionChanged = sortedChanged;
        //$scope.$apply();
        console.log("HEY!" + option);
        switch (option) {
            case 0:
                $scope.sortOption = "Sorted by High to Low";
                $scope.sortKey = '-ProjectPrice';
                break;
            case 1:
                $scope.sortOption = "Sorted by Low to High";
                $scope.sortKey = 'ProjectPrice';
                break;
            case 2:
                $scope.sortOption = "Sorted by Area (A to Z)";
                $scope.sortKey = 'ProjectName';
                break;
            case 3:
                $scope.sortOption = "Sorted by Area (Z to A)";
                $scope.sortKey = '-ProjectName';
                break;
        }
    }

    $scope.isEmpty = function (obj) {
        for (var i in obj) if (obj.hasOwnProperty(i)) return false;
        return true;
    };

   

    function pageInit() {
        if (DUMMY_DATA == true) {
            var dummyData = [{ "ProjectId": "26e5b81e-5b88-429d-aa16-6e28b4c6892c", "ProjectName": "MAPLE RESIDENCE", "ProjectLocation": "SUNGAI PUYU,BUTTERWORTH", "ProjectDetails": "Maple Residence is a new township conveniently located close to the busiest part of Butterworth town near the areas of Jalan Raja Uda and Sungai Dua. This up and coming township is built on a prime location that is easily accessible by Butterworth Outer Ring Road which connects to the North South Highway. It is the perfect place to be for those seeking the convenience of city living while staying in a quiet exclusive township.", "ProjectPrice": "RM538,000.00 onwards", "Website": "http://www.orientalmax.com.my", "CreateDate": "2015-07-05T21:14:06.42", "CreateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "UpdateDate": "2015-07-05T21:14:06.42", "UpdateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "PropertyURL": "https://farm4.staticflickr.com/3692/19409580336_efb664948c_m.jpg" }, { "ProjectId": "0d7a39ff-3901-4974-aece-3dcaf0ae5b6c", "ProjectName": "UL RESIDENCE", "ProjectLocation": "JALAN SEMPADAN,AIR ITAM", "ProjectDetails": "UL Residence is set to become the next iconic landmark of Air Itam. It’s exclusivity coupled with unique architectural designs will set it apart as a desired luxury home.\nIt is strategically located so that you can take a short break for some cool, fresh air up on Penang Hill. Make a visit to the KekLok Si Temple for a spiritual tour or go for a refreshing jog at the nearby Air Itam Dam.\nYou may be nestled within lush greenery, cushioned away from the harsh rigidity of a busy city life but your home is a mere stone’s throw away from the very heart of Air Itam– its busy morning market and shop houses – where an array of fresh ingredients are readily available for you or even some of Penang’s famous hawker fare, such as laksa, nasikandar, meegoring and many more, all situated right by your doorsteps.\nIt is living in the city behind the fortress of green solitude, specially designed for your comfort, after a day’s hard work.", "ProjectPrice": "RM1,800,000.00 onwards", "Website": "http://www.orientalmax.com.my", "CreateDate": "2015-07-06T17:02:51.027", "CreateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "UpdateDate": "2015-07-06T17:02:51.027", "UpdateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "PropertyURL": "https://farm4.staticflickr.com/3929/19461100035_9b84557def_m.jpg" }, { "ProjectId": "ed8d6ed5-651a-46ad-adf7-abf1409533cc", "ProjectName": "ELEMENT RESIDENCE", "ProjectLocation": "RAJA UDA,BUTTERWORTH", "ProjectDetails": "The Ultimate Garden City Experience\nElements Residence, make yourself at home at strategic, shimming beacon into the mature neighborhood. The delights of entertainment, public facilities and conveniences are all within your reach.\n\nE Residence is one of our latest Development \nFREEHOLD|OPEN FOR REGISTRATION\nFACILITIES CONDOMINIUM\nBuilt-Up Size\n• TYPE A±1,104 sq.ft.\n• TYPE B ±1,280 sq.ft.\n• TYPE C ±1,280 sq.ft.\n\n3 STOREY SUPER SIZE LINK-HOUSE\n-Built-Up Size ±2,700 sq.ft.\n-Land Size from ±1,500 sq.ft.\n-Limited 8 units only\n-Gated & Guarded \n-6 Bedrooms", "ProjectPrice": "RM300 per sq ft onwards", "Website": "http://www.orientalmax.com.my", "CreateDate": "2015-07-06T17:26:12.83", "CreateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "UpdateDate": "2015-07-06T17:26:12.83", "UpdateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "PropertyURL": "https://farm4.staticflickr.com/3756/19273972130_eb2b14cff5_m.jpg" }, { "ProjectId": "b0782f11-6da0-4602-8a07-52ce8ee3950a", "ProjectName": "18 EAST AT ANDAMAN CONDOMINIUMS", "ProjectLocation": "Located at the northern pinnacle of Malaysia’s Penang island is the exclusive seafront development of Seri Tanjung Pinang. At the heart of it lies the 18 East at Andaman condominiums named after the g", "ProjectDetails": "Located at the northern pinnacle of Malaysia’s Penang island is the exclusive seafront development of Seri Tanjung Pinang. At the heart of it lies the 18 East at Andaman condominiums named after the geographical coordinates of these splendid residences in Seri Tanjung Pinang. \n18 East at Andaman encapsulates the essence of resort-styled, seafront living right at your doorstep. The only condominium project in Malaysia with an expansive 4.5-acre private waterpark, it is no wonder these refined residences are touted as the finest in the region. Surrounded by a further 6.9 acres of lush green recreational space, the resort lifestyle desired by homeowners are complemented with world-class facilities, a clubhouse and a stunning view of the ocean", "ProjectPrice": "RM1200/sq ft", "Website": "http://www.quaysideresort.com/", "CreateDate": "2015-07-06T17:35:53.353", "CreateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "UpdateDate": "2015-07-06T17:35:53.353", "UpdateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "PropertyURL": "https://farm4.staticflickr.com/3954/19465992431_a6eb7f78b0_m.jpg" }, { "ProjectId": "5b1988c5-256c-40e8-b2b8-52a85ee06d1a", "ProjectName": "TestNewProperty2", "ProjectLocation": "Projecte here 好人", "ProjectDetails": "好人", "ProjectPrice": "300000", "Website": "yahoo.com", "CreateDate": "2015-07-08T20:02:05.877", "CreateWho": "23a271b0-5e51-40f1-843a-bfb00cacbf32", "UpdateDate": "2015-07-08T20:02:05.877", "UpdateWho": "23a271b0-5e51-40f1-843a-bfb00cacbf32", "PropertyURL": null }, { "ProjectId": "0857a05c-2331-42fe-aa74-264f8e80150f", "ProjectName": "Sentosa Residence", "ProjectLocation": "Kampung Baru, Bukit Mertajam, Penang", "ProjectDetails": "\nProperty Description\n\nProperty Features\n\n\n\nQuikPro No: PL-4686 \nAddress: Bukit Mertajam, Penang \nProperty Type: Condominium \nLand Title: Residential \nTenure: Freehold \nBuilt Up: 1200 - 2400 sq.ft. \n \n\nTotal Units/Lots: 96 \nBumi Discounts: 5% \nBedrooms: 3 - 5 \nBathrooms: 2 - 4 \nCompletion Date: 2017 (expected) \nPosted Date: 26/06/2015 \n  \n\nFacilities\n\n\n\n\n- Gated & Guarded\n - Swimming Pool\n - Lift Lobby\n - Covered Carpark\n - Jogging Path\n - Children Playground\n - Gymnasium\n - Barbecue Area\n - Community Hall\n - Reading Corner\n- Foot Reflexology Track \n - Landscape Area\n - CCTV\n - Card Access System\n\n* Provide 2 car parks for 1200 sq ft\n * Provide 3 car parks for 2400 sq ft\n\n \n\n\nProperty Details\n\n\n\n\n\n Additional Info: \n  \n 1.    Strategic location at Kampung Baru, Bukit Mertajam\n 2.    Near to business park, wet market place, famous primary & secondary school, Hospital, churches, \n        jogging park like Tokun Mountain \n 3.    Easy access to Juru Autocity, North South Highway & Penang Bridge.\n 4.    Surrounded by good and matured neighbourhood\n 5.    Low density — only 96 units\n\n6.    Bus, taxi, and train also available in Bukit Mertajam\n\n \n\nAmenities:\n\n1. Closed to the famous primary school like SJKC Kim Sen, 0.3 KM only.\n\n2. Closed to the famous Sek Rendah Convent, & Sek Menengah Convant, BM  0.5 Km only.\n\n3. Sek menengah Jit Sin Independant 1 Km only.\n\n4. Sek menegah Cina Jit Sin 3Km only.\n\n5. Pasar Awam kampung Baru 0.8Km only.\n\n6. Pasar Awam & Food Court Sentosa 0.3Km only.\n\n7. Pusat perniagaan Maju Jaya 0.2Km  only.\n\n8. Located  in CBD of Kampung Baru,Bukit Mertajam.\n\n9.Close to the Hospital, wet market, Business park, Shopping Mall, church, Telok Tokun Recreation Park , Bukit Minyak Industry Park , Penang Bridge, Juru Autocity, & North - South Highway\n", "ProjectPrice": "RM418,000.00 onwards", "Website": "http://solidbalance.com.my/", "CreateDate": "2015-08-01T13:53:26.137", "CreateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "UpdateDate": "2015-08-01T13:53:26.137", "UpdateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "PropertyURL": "https://farm1.staticflickr.com/432/20062422330_b152199499_m.jpg" }, { "ProjectId": "7bb54873-78b4-4ae2-93c7-8247338f58af", "ProjectName": "Setia V Residences", "ProjectLocation": "Batu Ferringhi, Penang", "ProjectDetails": "\n\nQuikPro No: PL-1878 \nAddress: Persiaran Gurney, Penang \nProperty Type: Condominium \nLand Title: Residential \nTenure: Freehold \nLand Area: 1.8 Acre \n \n\n \nTotal Units/Lots: 178 \nBumi Discounts: 5% \nBedrooms: 2 - 4 \nBathrooms: 2 - 4 \nPrice per sq ft: RM1,200 \nMaintenance Fee: RM0.40 psf \nCompletion Date: 2016 (expected) \nPosted Date: 08/07/2015 \n", "ProjectPrice": "\nFrom RM1,906,750 - RM8,962,800", "Website": "http://setiavresidences.com.my/", "CreateDate": "2015-08-01T20:58:11.39", "CreateWho": "91296169-8651-4a10-8ea5-34a1697f7d28", "UpdateDate": "2015-08-01T20:58:11.39", "UpdateWho": "91296169-8651-4a10-8ea5-34a1697f7d28", "PropertyURL": "https://farm4.staticflickr.com/3834/20241160522_a5699005f2_m.jpg" }, { "ProjectId": "a4df9a19-5001-4bf4-9a3c-45410430ffd0", "ProjectName": "PRESTIGE III", "ProjectLocation": "BALIK PULAU", "ProjectDetails": "Prestige III is strategically located in Balik Pulau, close to all the public amenities like new market, bus terminal, government offices, schools and also medical centre. Additional, Prestige III is located only 4 minutes driving distance from the town of Balik Pulau, 20 minutes to Penang International Airport, 30 minutes drive to Batu Ferringhi tourist belt and 40 minutes to Georgetown. Prince of Wales Island International School is just a stones throw from Prestige III. The establishment of the school in the township is expected to enhance demand and value of properties within the development. Without doubt, you will see an appreciation in value of your property here!\n\nProperty Type:\n•\tSST - 90 units (SOLD OUT)\n•\tDST - 224 units (SOLD OUT)\n•\tDST PHASE IV - 108 units\n•\tDSSD - Units available : 3 units left 401(type B RM1,163-146-00), 394 (type B - RM1,163-146-00) & 402 (type A - RM1,070,014-00)\n•\tMCA - 203 units\n•\tDSSO - 35 units\n•\tLCF - 250 units\nPrice:\n•\tDSSD RM1,070,014-00 onwards\n•\tDSSO - RM888,000 onwards\n \tPhase IV\nMCA -RM328,000 onwards \nDST - RM620,222 onwards \nDSSO - RM888,000 onwards\nTenure: Freehold", "ProjectPrice": "•\tDSSD RM1,070,014-00 onwards\n•\tDSSO - RM888,000 onwards\n \tPhase IV\nMCA -RM328,000 onwards \nDST - RM620,222 onwards \nDSSO - RM888,000 onwards", "Website": "http://plbhomes.com.my/showcase/prestigeiii/prestigeiii.asp", "CreateDate": "2015-08-28T10:20:25.603", "CreateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "UpdateDate": "2015-08-28T10:20:25.603", "UpdateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "PropertyURL": "https://farm1.staticflickr.com/766/20751709808_6c911dd5ff_m.jpg" }, { "ProjectId": "9e7d6a48-d051-4ffa-a573-af78acad52c2", "ProjectName": "DNP LAND", "ProjectLocation": " Bukit Minyak", "ProjectDetails": "Sentinelle Ville\nA hidden gem so carefully tucked away within a lush green neighbourhood. A captivating lifestyle filled with unprecedented refinement. Coming home to Sentinelle Ville is a luxury exclusively enjoyed by the discerning. Embrace the experience of prestige in the only gated and guarded precinct in BM Utama.\n\nLocation : Bukit Minyak\n\nNumber of units : 66\n\nType of units : 3-storey Semi-D (Gated Community)\n\nBuilt-up Area : 24’ x 50’/53’/50’ (approx. 3,609 sq ft)\n\nLand Area : 34’ x 85’ onwards\n\nSecurity Features :\n\n|      Gated & guarded\n|      24-hour security services\n|      CCTV surveillance & compound lighting\n|      Entry by access card\n|      Main door with digital door lock\n|      Home alarm system\n|      Intercom system (from guard house)\n|      High perimeter fencing\n|      Designated drop-off & pick-up area\n\nSentinelle Ville (Vila Sentri) • Developer’s License No. : 7432-10/03-2018/318 • Validity Period : 14/03/2013 – 13/03/2018 • Advertising Permit No. : 7432-10/04-2016/01663(P) • Validity Period : 08/04/2015 – 07/04/2016 • Land Tenure : Freehold • Building Plan Approval No. : MPSP/40/20-44/85 • Approving Authority : MPSP • Total Units : 66 units • Minimum Price : RM 1,088,800.00 • Maximum Price : RM 1,623,500.00 • Expected Completion Date : Dec 2015", "ProjectPrice": "Sentinelle Ville (Vila Sentri) • Developer’s License No. : 7432-10/03-2018/318 • Validity Period : 14/03/2013 – 13/03/2018 • Advertising Permit No. : 7432-10/04-2016/01663(P) • Validity Period : 08/04/2015 – 07/04/2016 • Land Tenure : Freehold • Building Plan Approval No. : MPSP/40/20-44/85 • Approving Authority : MPSP • Total Units : 66 units • Minimum Price : RM 1,088,800.00 • Maximum Price : RM 1,623,500.00 • Expected Completion Date : Dec 2015", "Website": "http://www.dnpland.com.my/index.php/current-projects/sentinelle-ville/", "CreateDate": "2015-08-28T10:28:37.713", "CreateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "UpdateDate": "2015-08-28T10:28:37.713", "UpdateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "PropertyURL": "https://farm6.staticflickr.com/5667/20930123932_6e3be32549_m.jpg" }, { "ProjectId": "5a36b30c-0040-4b8a-947d-e59bfacc3323", "ProjectName": "DNP LAND", "ProjectLocation": "Alma", "ProjectDetails": "Lakeside Superlink\nLakeside Superlink, a prestigious residential enclave surrounded by mesmerising landscaped gardens and lakes offers you the perfect blend of luxury, comfort and style.\n\nLocation : Alma\n\nNumber of units : 198\n\nType of units : 2-storey Superlink Home\n\nBuilt-up Area : 23’ x 50’/60’ (approx. 2,408 sq ft)\n\nLand Area : Type A – 23′ x 75′ onwards  |  Type B – 22’ x 75’ onwards\n\nLakeside Superlink (Taman Jasa Intan) • Developer’s License No. : 7432-11/04-2016/01705(L) • Validity Period : 16/04/2015 – 15/04/2016 • Advertising Permit No. : 7432-11/04-2016/01705(P) • Validity Period : 16/04/2015 – 15/04/2016 • Land Tenure : Freehold • Building Plan Approval No. : MPSP/40/20-45/87 • Approving Authority : MPSP • Total Units : 198 units (Type A : 158 units ; Type B : 40 units)• Minimum Price : RM 690,000.00 • Maximum Price : RM 1,047,600.00 • Expected Completion Date : Sep 2015", "ProjectPrice": "Lakeside Superlink (Taman Jasa Intan) • Developer’s License No. : 7432-11/04-2016/01705(L) • Validity Period : 16/04/2015 – 15/04/2016 • Advertising Permit No. : 7432-11/04-2016/01705(P) • Validity Period : 16/04/2015 – 15/04/2016 • Land Tenure : Freehold • Building Plan Approval No. : MPSP/40/20-45/87 • Approving Authority : MPSP • Total Units : 198 units (Type A : 158 units ; Type B : 40 units)• Minimum Price : RM 690,000.00 • Maximum Price : RM 1,047,600.00 • Expected Completion Date : Sep 2015", "Website": "http://www.dnpland.com.my/index.php/current-projects/lakeside-superlink/", "CreateDate": "2015-08-28T10:37:45.72", "CreateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "UpdateDate": "2015-08-28T10:37:45.72", "UpdateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "PropertyURL": "https://farm6.staticflickr.com/5701/20930253842_78d9f9c39b_m.jpg" }, { "ProjectId": "afa33000-09ab-478c-9fed-9129d5ea8c35", "ProjectName": "DNP LAND", "ProjectLocation": "Alma", "ProjectDetails": "Mahkota Impian\nMahkota Impian is the hallmark of modern urban suites. It places equal emphasis on the style, elegance, function and dynamic versatility. This high-rise serviced residence has plenty to offer in form of facilities. Further on, within minutes of Mahkota Impian, you can find abundance of recreational options, excellent educational and shopping conveniences.\n\n \n\nLocation : Alma\n\nNumber of units : 360 (Serviced Apartment)\n\nType of units : Shop lots and 3 blocks of serviced apartment\n\nFloor Area : 1,156 sq ft – 1,181 sq ft\n\nSecurity Features :\n\n|      Main entrance security check point with access card system\n|      24-hour security\n|      intercom system\n|      CCTV surveillance\n|      Perimeter fencing\n\nMahkota Impian – Developer’s License No. : 7432-12/06-2016/0580(L) • Validity Period : 14/06/2014 – 13/06/2016 • Advertising Permit No. : 7432-12/06-2016/0580(P) • Validity Period : 14/06/2014 – 13/06/2016 • Land Tenure : Freehold • Building Plan Approval No. : MPSP/40/20-45/98 • Approving Authority : MPSP • Total Units : 360 units (Block B : 112 units ; Block C : 112 units ; Block D : 136 units) • Minimum Price : RM466,000.00 • Maximum Price : RM525,000.00 • Expected Completion Date : Oct 2017", "ProjectPrice": "Mahkota Impian – Developer’s License No. : 7432-12/06-2016/0580(L) • Validity Period : 14/06/2014 – 13/06/2016 • Advertising Permit No. : 7432-12/06-2016/0580(P) • Validity Period : 14/06/2014 – 13/06/2016 • Land Tenure : Freehold • Building Plan Approval No. : MPSP/40/20-45/98 • Approving Authority : MPSP • Total Units : 360 units (Block B : 112 units ; Block C : 112 units ; Block D : 136 units) • Minimum Price : RM466,000.00 • Maximum Price : RM525,000.00 • Expected Completion Date : Oct 2017", "Website": "http://www.dnpland.com.my/index.php/current-projects/mahkota-impian/", "CreateDate": "2015-08-28T10:42:15.263", "CreateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "UpdateDate": "2015-08-28T10:42:15.263", "UpdateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "PropertyURL": "https://farm6.staticflickr.com/5675/20752102448_1f9a5d89d5_m.jpg" }, { "ProjectId": "a446e2f5-c195-4495-b3f2-cdc966cffb18", "ProjectName": "DNP LAND", "ProjectLocation": "BUKIT MINYAK", "ProjectDetails": "BM Utama Phase 5  OPEN FOR REGISTRATION!\n\nLocation : Bukit Minyak\n\nType of units : 2-storey Link Home & Semi-D\n\n", "ProjectPrice": "UNKNOWN", "Website": "http://www.dnpland.com.my/index.php/current-projects/bm-utama-phase-5/", "CreateDate": "2015-08-28T10:45:12.617", "CreateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "UpdateDate": "2015-08-28T10:45:12.617", "UpdateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "PropertyURL": "https://farm6.staticflickr.com/5761/20319081063_f72991289b_m.jpg" }, { "ProjectId": "b387ad1f-9f1c-4abf-867d-9a1e89280612", "ProjectName": "ASTON PARK EAST (BM)", "ProjectLocation": "Bukit Mertajam Penang", "ProjectDetails": "Aston Park East, a gated and guarded housing scheme in bustling township of Bukit Mertajam. This is the first phase of Aston Park development by Harta Intan Group, located adjacent to Aston Villa, just a short walking distance from from The Summit (BM Plaza). It comprises 45 units of 3-storey terrace houses.\n\nFuture development:\n\nPhase 2: 52 units of 3-storey terrace houses\nPhase 3: 12-storey condominium with 52 residential units\nProperty Project : Aston Park East\nLocation : Bukit Mertajam, Penang\nProperty Type : 3-storey terrace\nLand Tenure : Freehold\nTotal Units : 52\nDeveloper : Harta Intan Group", "ProjectPrice": "UNKNOWN", "Website": "http://www.penangpropertytalk.com/2015/03/aston-park-east/", "CreateDate": "2015-08-28T10:54:49.7", "CreateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "UpdateDate": "2015-08-28T10:54:49.7", "UpdateWho": "707fa990-52f3-4d2d-b053-5937f2942236", "PropertyURL": "https://farm1.staticflickr.com/779/20319257373_4b4b95f200_m.jpg" }, { "ProjectId": "3be805e7-93f5-467f-85fc-4a8055a4def5", "ProjectName": "The Navens, Condominium @Bukit Mertajam, Penang", "ProjectLocation": "Jalan Machang Bubok 3, Machang Bubok, Bukit Mertajam, Penang", "ProjectDetails": "The Navens offers you both a resort-style living with fun-filled thematic recreations at your doorstep and a well-balanced lush greenery space for those seeking quietude and serenity.\nDefinitely a refreshing change from the hustle & bustle of a hectic city life. A living space that gets you in the mood.\nPreparing you a state of pure bliss and a mind to unwind from your hectic day.", "ProjectPrice": "Completion Year", "Website": "http://www.whhland.com/the_navens", "CreateDate": "2016-01-14T21:50:24.847", "CreateWho": "378790d6-47b7-42d2-ba45-b8affb77b7d9", "UpdateDate": "2016-01-14T21:50:24.847", "UpdateWho": "378790d6-47b7-42d2-ba45-b8affb77b7d9", "PropertyURL": null }, { "ProjectId": "e584edc6-079d-41a5-83c6-fb4a66325312", "ProjectName": "Iconic Skies", "ProjectLocation": "Bayan Lepas", "ProjectDetails": "LUXURY CODOMINIUM\n\nGiven an unobstructed view as the magnificent backdrop of your living spaces, you are about to enjoy unprecedented privacy amidst an epitome of nature and prestige.\n\nDesigned with spacious build-up from 760 - 2976 sqft, emphasis is given to contemporary living without compromising practicality. Set your mind free and revel in the absolute relaxation, this is where your prestige blends well with privacy.", "ProjectPrice": "500000", "Website": "http://www.iconicskies.com/", "CreateDate": "2016-01-17T22:30:21.543", "CreateWho": "378790d6-47b7-42d2-ba45-b8affb77b7d9", "UpdateDate": "2016-01-17T22:30:21.543", "UpdateWho": "378790d6-47b7-42d2-ba45-b8affb77b7d9", "PropertyURL": null }, { "ProjectId": "b691c033-32c3-4374-aebd-766c3fb623e1", "ProjectName": "The Tamarind Executive Apartment", "ProjectLocation": "Seri Tanjung Pinang, Tanjung Tokong", "ProjectDetails": "Project Details\n\nImagine living at the centre of it all. An address that places you at the very heart of the lifestyle you want to lead. Make a home in Penang’s most desirable neighbourhood, Seri Tanjung Pinang, brought to you by the E&O Group.\nDiscover The Tamarind, your nest to fill with love and loved ones, aspirations and inspirations, journeys and milestones.\nComprising two towers of 552 units each, The Tamarind sits on 7 acres of freehold land featuring lush landscaping for families of all sizes.\nPractical layouts and mindful designs make the perfect canvas to express your style and individuality. All apartments feature 3 bedrooms and 2 bathrooms, and sizes start at 1,047 square feet, promising spacious and carefree living. Units are bright and airy with generous balconies for lofty views of this special corner of Penang.", "ProjectPrice": "00000", "Website": "http://www.easternandoriental.com/properties-location-project.php?maincat=location&cat=penang&id=the-tamarind-executive-apartments", "CreateDate": "2016-01-17T22:52:07.86", "CreateWho": "378790d6-47b7-42d2-ba45-b8affb77b7d9", "UpdateDate": "2016-01-17T22:52:07.86", "UpdateWho": "378790d6-47b7-42d2-ba45-b8affb77b7d9", "PropertyURL": null }, { "ProjectId": "6502eecd-d33a-4609-8a7d-621e72cfb94a", "ProjectName": "The Starhill Garden", "ProjectLocation": "Jalan Baru, Prai, Penang", "ProjectDetails": "A proposed 31-storey residential development by Wern Properties in Perai, Penang. This development is strategically located along Jalan Baru, next to The Signature condominium by Excel Focus Properties Sdn. Bhd. It is only within mere minutes drive from Penang bridge.", "ProjectPrice": "RM385,000 onwards", "Website": "http://www.penangpropertytalk.com/2015/03/the-starhill-garden/", "CreateDate": "2016-01-29T21:04:36.77", "CreateWho": "378790d6-47b7-42d2-ba45-b8affb77b7d9", "UpdateDate": "2016-01-29T21:04:36.77", "UpdateWho": "378790d6-47b7-42d2-ba45-b8affb77b7d9", "PropertyURL": null }];
            $scope.searchData = dummyData;
            console.log($scope.searchData.length);
            $scope.totalItems = $scope.searchData.length;
            $scope.currentPage = 1;
            $scope.numPerPage = 10;
        } else {
            $http.get('api/PropertyNew/GetPropertyNew').success(function (data) {
                console.log("New Launch: " + data)
                $scope.searchData = data;
                $scope.totalItems = $scope.searchData.length;
                $scope.currentPage = 1;
                $scope.numPerPage = 10;
            });
        }
        

      
    }




    //$scope.propertyStateName = "State";
    //$scope.propertyType = "Property Type";
    //$scope.propertyStateId = "";
    //$scope.propertyTransact = "";
    //$scope.propertyLocation = "Location";
    //$scope.propertyProject = "";
    //$scope.propertyPriceMin = 0;
    //$scope.propertyPriceMax = 99999999;
    //$scope.data.searchData = [];


    //$scope.updateTransact = function (transact, transactChanged) {
    //    $scope.propertyTransactChanged = transactChanged;
    //    $scope.property.Transact = transact;
    //    switch (transact) {
    //        case 'S':
    //            $scope.property.TransactName = "Sale";
    //            break;
    //        case 'R':
    //            $scope.property.TransactName = "Rent";
    //            break;
    //    }
    //}


    //$scope.updateProperty = function (property, propertyChanged) {
    //    $scope.propertyTypeChanged = propertyChanged;
    //    $scope.property.type = property;
    //    switch(property){
    //        case 'R':
    //            $scope.property.TypeName = "Residential";
    //            break;
    //        case 'C':
    //            $scope.property.TypeName = "Commercial";
    //            break;
    //        case 'I':
    //            $scope.property.TypeName = "Industrial";
    //            break;
    //        case 'L':
    //            $scope.property.TypeName = "Land";
    //            break;
    //    }
    //}

    //$scope.updateLocation = function (location, locationStateChanged) {
    //    $scope.property.Location = location;
    //    $scope.propertyLocationChanged = locationStateChanged;
    //}

    //$scope.changeState = function (id, name,stateChanged) {
    //    console.log("Name: " + name);
    //    $scope.propertyStateChanged = stateChanged;
    //    $scope.property.StateName = name;
    //    $scope.property.StateId = id;

    //    if (id != null) {
    //        console.log("Property State ID: " + $scope.propertyStateId);
    //        $http.get('api/Property/GetLocation/' + id)
    //       .success(function (data) {
    //           console.log("Data!: " + JSON.stringify(data));
    //           $scope.locations = data;
    //       }
    //       )
    //    }
    //}

    //$scope.isPropertyTransactSale = function (obj) {
    //    return obj == 'S' ? true : false;
    //}

  


   

    //$scope.search = function () {
    //    url = 'api/PropertySearch/GetSaleProperty';
    //    $scope.property.SaleType = $scope.property.Transact + $scope.property.Type;

    //    console.log("Property: " + JSON.stringify($scope.property));
    //    console.log("Min Price: " + $scope.property.PriceMin);
    //    console.log("Max Price: " + $scope.property.PriceMax);
    //    console.log("URL: " + url);


    //    if ($scope.property.PriceMin == null || $scope.property.PriceMax == null) {
    //        $scope.property.PriceMin = 0;
    //        $scope.property.PriceMax = 99999999;
    //    }


    //    $http.post(url, $scope.property)
    //         .success(function (result) {
    //             console.log("RESULT: " + JSON.stringify(result));
    //             $scope.searchData = result;
    //             $scope.totalItems = $scope.searchData.length;
    //             $scope.currentPage = 1;
    //             $scope.numPerPage = 10;
    //             //$scope.loader.loading = false;
    //             //$scope.data.searchData = result;
    //             //window.prerenderReady = true;

    //         })
    //         .error(function (result) {
    //             console.log("ERROR: " + result);
    //             //console.log("Error");
    //             //console.log(result);
    //             //$scope.loader.loading = false;
    //             //window.prerenderReady = true;

    //         }
    //     )
    //}

   

   


});